﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// DeviceRelation数据模型对象
    /// </summary>
    [Serializable]
    public partial class DeviceRelationMod
    {
        /// <summary>
        /// 初始化DeviceRelation数据模型对象
        /// </summary>
        public DeviceRelationMod()
        {
            
        }
        /// <summary>
        /// 初始化DeviceRelation数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="iMEI">IMEI</param>
        /// <param name="deviceNO">DeviceNO</param>
        /// <param name="iCCID">ICCID</param>
        /// <param name="syncTime">SyncTime</param>
        /// <param name="cTime">CTime</param>
        /// <param name="accCheck">AccCheck</param>
        public DeviceRelationMod(string iMEI,string deviceNO,string iCCID,int syncTime,DateTime cTime,int accCheck)
        {
            //给IMEI字段赋值
            this.IMEI = iMEI;
            //给DeviceNO字段赋值
            this.DeviceNO = deviceNO;
            //给ICCID字段赋值
            this.ICCID = iCCID;
            //给SyncTime字段赋值
            this.SyncTime = syncTime;
            //给CTime字段赋值
            this.CTime = cTime;
            //给AccCheck字段赋值
            this.AccCheck = accCheck;
        }
        /// <summary>
        /// 初始化DeviceRelation数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iMEI">IMEI</param>
        /// <param name="deviceNO">DeviceNO</param>
        /// <param name="iCCID">ICCID</param>
        /// <param name="version">Version</param>
        /// <param name="bState">BState</param>
        /// <param name="chargeLevel">ChargeLevel</param>
        /// <param name="voltage">Voltage</param>
        /// <param name="singleData">SingleData</param>
        /// <param name="onlineMode">OnlineMode</param>
        /// <param name="syncTime">SyncTime</param>
        /// <param name="cTime">CTime</param>
        /// <param name="servPara">ServPara</param>
        /// <param name="hardVer">HardVer</param>
        /// <param name="alarmTime">AlarmTime</param>
        /// <param name="remark">Remark</param>
        /// <param name="servLastTime">ServLastTime</param>
        /// <param name="accCheck">AccCheck</param>
        public DeviceRelationMod(string iMEI,string deviceNO,string iCCID,string version,string bState,int? chargeLevel,int? voltage,int? singleData,int? onlineMode,int syncTime,DateTime cTime,string servPara,string hardVer,DateTime? alarmTime,string remark,DateTime? servLastTime,int accCheck)
        {
            //给IMEI字段赋值
            this.IMEI = iMEI;
            //给DeviceNO字段赋值
            this.DeviceNO = deviceNO;
            //给ICCID字段赋值
            this.ICCID = iCCID;
            //给Version字段赋值
            this.Version = version;
            //给BState字段赋值
            this.BState = bState;
            //给ChargeLevel字段赋值
            this.ChargeLevel = chargeLevel;
            //给Voltage字段赋值
            this.Voltage = voltage;
            //给SingleData字段赋值
            this.SingleData = singleData;
            //给OnlineMode字段赋值
            this.OnlineMode = onlineMode;
            //给SyncTime字段赋值
            this.SyncTime = syncTime;
            //给CTime字段赋值
            this.CTime = cTime;
            //给ServPara字段赋值
            this.ServPara = servPara;
            //给HardVer字段赋值
            this.HardVer = hardVer;
            //给AlarmTime字段赋值
            this.AlarmTime = alarmTime;
            //给Remark字段赋值
            this.Remark = remark;
            //给ServLastTime字段赋值
            this.ServLastTime = servLastTime;
            //给AccCheck字段赋值
            this.AccCheck = accCheck;
        }
        
		//属性存储数据的变量
        private string _iMEI;
        private string _deviceNO;
        private string _iCCID;
        private string _version;
        private string _bState;
        private int? _chargeLevel;
        private int? _voltage;
        private int? _singleData;
        private int? _onlineMode;
        private int _syncTime;
        private DateTime _cTime;
        private string _servPara;
        private string _hardVer;
        private DateTime? _alarmTime;
        private string _remark;
        private DateTime? _servLastTime;
        private int _accCheck;
        
        /// <summary>
        /// IMEI
        /// </summary>
        public string IMEI
        {
            get { return this._iMEI; }
            set { this._iMEI = value; }
        }
        /// <summary>
        /// DeviceNO
        /// </summary>
        public string DeviceNO
        {
            get { return this._deviceNO; }
            set { this._deviceNO = value; }
        }
        /// <summary>
        /// ICCID
        /// </summary>
        public string ICCID
        {
            get { return this._iCCID; }
            set { this._iCCID = value; }
        }
        /// <summary>
        /// Version
        /// </summary>
        public string Version
        {
            get { return this._version; }
            set { this._version = value; }
        }
        /// <summary>
        /// BState
        /// </summary>
        public string BState
        {
            get { return this._bState; }
            set { this._bState = value; }
        }
        /// <summary>
        /// ChargeLevel
        /// </summary>
        public int? ChargeLevel
        {
            get { return this._chargeLevel; }
            set { this._chargeLevel = value; }
        }
        /// <summary>
        /// Voltage
        /// </summary>
        public int? Voltage
        {
            get { return this._voltage; }
            set { this._voltage = value; }
        }
        /// <summary>
        /// SingleData
        /// </summary>
        public int? SingleData
        {
            get { return this._singleData; }
            set { this._singleData = value; }
        }
        /// <summary>
        /// OnlineMode
        /// </summary>
        public int? OnlineMode
        {
            get { return this._onlineMode; }
            set { this._onlineMode = value; }
        }
        /// <summary>
        /// SyncTime
        /// </summary>
        public int SyncTime
        {
            get { return this._syncTime; }
            set { this._syncTime = value; }
        }
        /// <summary>
        /// CTime
        /// </summary>
        public DateTime CTime
        {
            get { return this._cTime; }
            set { this._cTime = value; }
        }
        /// <summary>
        /// ServPara
        /// </summary>
        public string ServPara
        {
            get { return this._servPara; }
            set { this._servPara = value; }
        }
        /// <summary>
        /// HardVer
        /// </summary>
        public string HardVer
        {
            get { return this._hardVer; }
            set { this._hardVer = value; }
        }
        /// <summary>
        /// AlarmTime
        /// </summary>
        public DateTime? AlarmTime
        {
            get { return this._alarmTime; }
            set { this._alarmTime = value; }
        }
        /// <summary>
        /// Remark
        /// </summary>
        public string Remark
        {
            get { return this._remark; }
            set { this._remark = value; }
        }
        /// <summary>
        /// ServLastTime
        /// </summary>
        public DateTime? ServLastTime
        {
            get { return this._servLastTime; }
            set { this._servLastTime = value; }
        }
        /// <summary>
        /// AccCheck
        /// </summary>
        public int AccCheck
        {
            get { return this._accCheck; }
            set { this._accCheck = value; }
        }
        
        /// <summary>
        /// 对比两个DeviceRelation数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的DeviceRelation数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成DeviceRelation数据模型对象
            DeviceRelationMod deviceRelationMod = obj as DeviceRelationMod;
            //判断是否转换成功
            if (deviceRelationMod == null) return false;
            //进行匹配属性的值
            return
                //判断IMEI是否一致
                this.IMEI == deviceRelationMod.IMEI &&
                //判断DeviceNO是否一致
                this.DeviceNO == deviceRelationMod.DeviceNO &&
                //判断ICCID是否一致
                this.ICCID == deviceRelationMod.ICCID &&
                //判断Version是否一致
                this.Version == deviceRelationMod.Version &&
                //判断BState是否一致
                this.BState == deviceRelationMod.BState &&
                //判断ChargeLevel是否一致
                this.ChargeLevel == deviceRelationMod.ChargeLevel &&
                //判断Voltage是否一致
                this.Voltage == deviceRelationMod.Voltage &&
                //判断SingleData是否一致
                this.SingleData == deviceRelationMod.SingleData &&
                //判断OnlineMode是否一致
                this.OnlineMode == deviceRelationMod.OnlineMode &&
                //判断SyncTime是否一致
                this.SyncTime == deviceRelationMod.SyncTime &&
                //判断CTime是否一致
                this.CTime == deviceRelationMod.CTime &&
                //判断ServPara是否一致
                this.ServPara == deviceRelationMod.ServPara &&
                //判断HardVer是否一致
                this.HardVer == deviceRelationMod.HardVer &&
                //判断AlarmTime是否一致
                this.AlarmTime == deviceRelationMod.AlarmTime &&
                //判断Remark是否一致
                this.Remark == deviceRelationMod.Remark &&
                //判断ServLastTime是否一致
                this.ServLastTime == deviceRelationMod.ServLastTime &&
                //判断AccCheck是否一致
                this.AccCheck == deviceRelationMod.AccCheck;
        }
        /// <summary>
        /// 将当前DeviceRelation数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将DeviceRelation数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将IMEI进行按位异或运算处理
                (this.IMEI == null ? 2147483647 : this.IMEI.GetHashCode()) ^
                //将DeviceNO进行按位异或运算处理
                (this.DeviceNO == null ? 2147483647 : this.DeviceNO.GetHashCode()) ^
                //将ICCID进行按位异或运算处理
                (this.ICCID == null ? 2147483647 : this.ICCID.GetHashCode()) ^
                //将Version进行按位异或运算处理
                (this.Version == null ? 2147483647 : this.Version.GetHashCode()) ^
                //将BState进行按位异或运算处理
                (this.BState == null ? 2147483647 : this.BState.GetHashCode()) ^
                //将ChargeLevel进行按位异或运算处理
                (this.ChargeLevel == null ? 2147483647 : this.ChargeLevel.GetHashCode()) ^
                //将Voltage进行按位异或运算处理
                (this.Voltage == null ? 2147483647 : this.Voltage.GetHashCode()) ^
                //将SingleData进行按位异或运算处理
                (this.SingleData == null ? 2147483647 : this.SingleData.GetHashCode()) ^
                //将OnlineMode进行按位异或运算处理
                (this.OnlineMode == null ? 2147483647 : this.OnlineMode.GetHashCode()) ^
                //将SyncTime进行按位异或运算处理
                this.SyncTime.GetHashCode() ^
                //将CTime进行按位异或运算处理
                this.CTime.GetHashCode() ^
                //将ServPara进行按位异或运算处理
                (this.ServPara == null ? 2147483647 : this.ServPara.GetHashCode()) ^
                //将HardVer进行按位异或运算处理
                (this.HardVer == null ? 2147483647 : this.HardVer.GetHashCode()) ^
                //将AlarmTime进行按位异或运算处理
                (this.AlarmTime == null ? 2147483647 : this.AlarmTime.GetHashCode()) ^
                //将Remark进行按位异或运算处理
                (this.Remark == null ? 2147483647 : this.Remark.GetHashCode()) ^
                //将ServLastTime进行按位异或运算处理
                (this.ServLastTime == null ? 2147483647 : this.ServLastTime.GetHashCode()) ^
                //将AccCheck进行按位异或运算处理
                this.AccCheck.GetHashCode();
        }
        /// <summary>
        /// 将当前DeviceRelation数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前DeviceRelation数据模型对象转换成字符串副本
            return
                "[" +
                //将IMEI转换成字符串
                this.IMEI + "," +
                //将DeviceNO转换成字符串
                this.DeviceNO + "," +
                //将ICCID转换成字符串
                this.ICCID + "," +
                //将SyncTime转换成字符串
                this.SyncTime + "," +
                //将CTime转换成字符串
                this.CTime + "," +
                //将AccCheck转换成字符串
                this.AccCheck +
                "]";
        }
    }
}
